package com.training.java.core.exceptionhandling;

public class TransferService {

	    double checkingAccountBalance=1000;
	    double savingAccountBalance=1000;
		public void transfer(double howMuch) throws InsufficientBalanceException
		{
			if(howMuch>checkingAccountBalance)
			{
				throw new InsufficientBalanceException("Insufficient money in your checking account");
				
			}
			checkingAccountBalance= checkingAccountBalance-howMuch;
			savingAccountBalance=savingAccountBalance +howMuch;
			
			System.out.println("Money in ur checkingAccount= " + checkingAccountBalance);
			System.out.println("Money in ur savingAccount= "+ savingAccountBalance);
		}

	
}
